<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>电子服务单</title>
  <!--startprint-->
  <style>
    p{
      margin-bottom:0px!important;
      margin-top: 0!important;
    }
    body{margin: 0; padding: 0;}
    .tongyin{width:850px;background:color('white');margin: 0 auto; overflow: hidden;}
    .tongyin_bg{background-size:99%; position: relative; background-position-y: 64%; }
    .ty-head{width: 100%;height: 60px; margin-top: 50px;}
    .logo{height: 56px;
      float: left;
      margin-top: 20px;
      width: 100%;
      text-align: center;
    }
    .logo img{height:56px;margin: 0 5px;}
    .ty-head .text{
      float:right;
      font-weight:bold;

    }
    .ty-head font{
      margin:10px 5px;
      font-size: 12px;
      font-weight: bold;
      float: right;
    }
    .t-title{
      width:708px;
      margin: 0 auto;
      overflow: hidden;
    }
    .t-title h2{
      text-align: center;
      font-weight: normal;
      font-family: "微软雅黑";

    }
    .t-title .title-right{
      width:100%;
      overflow: hidden;
    }
    .title-right span{
      display: block;
      font-size: 14px;
    }
    .sp1{
      width: 200px;
      float: left;
    }
    .sp2{
      width: 240px;
      float: left;
    }
    .t-title p{
      text-indent: 2rem;
    }
    table{
      width: 764px;
      /*height:800px;*/
      margin: 0 auto;
      font-size: 14px;
      text-align: center;

    }
    table td{
      padding:0 5px;
    }

    table tr td{
      width: 200px;
      /*width: 45.7px;*/
      height:30px;
    }
    table tr:nth-child(1) td:nth-child(1){
      width:60px;
    }
    table tr:nth-child(1) td:nth-child(2){
      width: 240px;
    }
    table tr:nth-child(1) td:nth-child(3){
      width: 220px;
    }
    table tr:nth-child(1) td:nth-child(4){
      width: 80px;
    }
    table tr:nth-child(2) td:nth-child(4){
      width: 80px;
    }
    table tr:nth-child(4) td:nth-child(4){
      width:40px;
    }
    table tr:nth-child(4) td:nth-child(5){
      width: 100px;
    }
    table tr:nth-child(7) td:nth-child(1){
      width:250px;
    }
    table tr:nth-child(7) td:nth-child(2){
      width:50px;
    }
    table tr:nth-child(7) td:nth-child(3){
      width:200px;
    }
    table tr:nth-child(7) td:nth-child(4){
      width:100px;
    }
    .nbtn{
      height: 38px;
      line-height: 38px;
      border: 1px solid transparent;
      padding: 0 18px;
      background-color: #1E9FFF;
      color: #fff;
      white-space: nowrap;
      text-align: center;
      font-size: 14px;
      border-radius: 2px;
      cursor: pointer;
      width: 15%;
    }
    /*步骤条*/
    .top{
      display: flex;
      font-size: 30px;
      justify-content: center;
      padding-top: 30px;
      background: #f2f2f2;
      padding-bottom: 40px

    }
    .top_li{
      text-align: center;
      position: relative;
      width:60px
    }
    .red{
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: #ccc;
      margin:0 auto;
      margin-top: 55px;
    }
    .name{
      position: absolute;
      width: 150px;
      left: -44px;
      top: 0;
      color:#666;
    }
    .xian{
      width: 320px;
      height: 2px;
      background:#ccc;
      margin-top: 59px;
    }
    .name.active{
      color:#3683D3;
    }
    .red.active{
      background: #3683D3
    }
    .xian.active{
      background: #3683D3
    }
    /*弹窗*/
    .model_k{
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background:rgba(0,0,0,0.4);
      z-index: 0;
      display: none;
    }
    .model{
      width: 100%;
      position: absolute;
      top: 40%;
      display: flex;
      justify-content:center;
      z-index: 11
    }
    .model_val{
      background: #fff;
      width: 80%;
      border-radius: 10px;
      font-size: 30px
    }
    .model_val .model_tit{
      text-align: center;
      padding:25px;
      color:#333;
      font-weight: bold;
    }
    .model_val .model_tip{
      padding:0 25px;
      color:#666;
    }
    .model_btn{
      margin-top: 27px;
      display: flex;
    }
    .model_btn .mbtn{
      width: 50%;
      text-align: center;
      padding:27px;
      box-sizing: border-box;
      border-top: 1px solid #ccc;
    }
    .mbtn.que{
      border-left: 1px solid #ccc;
      color:#3683D3;
      text-decoration: unset;
    }
  </style>
</head>
<body>
<div class="top">
  <div class="top_li">
    <div class="name active">浏览</div>
    <div class="red active"></div>
  </div>
  <!--  <div class="xian "></div>-->
  <!--  <div class="top_li">-->
  <!--    <div class="name ">短信验证</div>-->
  <!--    <div class="red"></div>-->
  <!--  </div>-->
  <div class="xian "></div>
  <div class="top_li">
    <div class="name">在线支付</div>
    <div class="red"></div>
  </div>
</div>
<div class="tongyin" id="tongyin">
  <div class="tongyin_bg">
    <div class="ty-head">
      <div class="logo">

        <div class="text" style="width: 100%;text-align: center;display:flex;">
          <img id="" src="{$site.bjd_logo}" alt="" style="width: 144px;height: auto;position: absolute;left: 52px;top: 9px;"/>

          <div style="font-size: 14px;font-weight: 400;margin-top: -20px;position: absolute;left: 50px;top: 157px;">
            服务热线:<span style="color:red">{$site.bjd_phone}</span>
          </div>
          <div style="margin:0 auto">
            <h1 style="color: #0a0a0a;font-size: 28px; margin: 0 auto;display: initial;">机动车交通安全综合服务</h1>
          </div>

          <img id="" src="{$site.bjd_ewm}" alt="" style="width:110px;height:110px;    position: absolute;right: 60px;top: 10px;"/>
        </div>
      </div>

    </div>

    <!--标题-->
    <div class="t-title">
      <h2 style="margin:10px 0;font-size: 20px">电子单（正本）</h2>
      <div class="title-right" style="margin-bottom:20px;">
        <span class="sp2" style="margin-left: 60%;position: absolute;left: 40px;top: 124px;">服务单号：<text style="">{$res.tong_number}</text></span>
      </div>


    </div>
    <p style="font-size: 13px;width: 100%;text-align: center;margin-bottom: 0;padding: 10px;padding-top: 20px;">鉴于车辆所有人提出参加交通安全服务申请，并同意按约定支付服务金，依照参加交通安全服务的项目及对应条款和特别约定承担补偿责任。</p>
    <table border="1px" cellspacing="0" cellpadding="0">
      <tr>
        <td>被服务人</td>
        <td colspan="2">{$res.learned_name}</td>
        <td colspan="2">身份证号/统一社会信用代码</td>
        <td colspan="2">{$res.learned_num}</td>
      </tr>
      <tr>
        <td rowspan="5">服务车辆情况</td>
        <td>号码号牌</td>
        <td>{$res.car_num}</td>
        <td>厂牌型号</td>
        <td colspan="3">{$res.car_factory_num}</td>
      </tr>
      <tr>
        <td>VIN码/车架号</td>
        <td colspan="2">{$res.car_vin}</td>
        <td>发动机号</td>
        <td colspan="2">{$res.car_engine}</td>
      </tr>
      <tr>
        <td>初次登记日期</td>
        <td>{$res.car_register|date='Y-m-d',###}</td>
        <td>排量/功率</td>
        <td>{$res.car_displacement}/{$res.car_power}</td>
        <td>核定载质量</td>
        <td style="text-align: center;">{$res.car_carry_quality}千克</td>
      </tr>
      <tr>
        <td>车辆种类</td>
        <td>{$res.car_kind|default="/"}</td>
        <td>使用性质</td>
        <td>{$res.car_use_nature_str|default="/"}</td>
        <td>核定载客</td>
        <td style="text-align: center;">{$res.car_carry_peo}人</td>

      </tr>
      <tr>
        <td>新车购置价</td>
        <td>{$res.car_buy|default="/"}</td>
        <td>行驶区域</td>
        <td>{$res.car_province|default="/"}</td>
        <td>已使用年限</td>
        <td style="text-align: center;"><?php if($res['car_age']){ echo $res['car_age'].'年'; }else{ echo '/'; }?></td>
      </tr>
      <tr>
        <td colspan="3">服务种类</td>
        <td>不计免赔</td>
        <td colspan="2">服务金额/责任限额（元）</td>
        <td colspan="1">服务费（元）</td>
      </tr>
      {foreach name="tc_list" item="tc_vo"}
      <tr>
        {eq name="tc_vo.tczl" value="不计免赔服务"}
        {if $tc_vo['tcf'] > 0}
        <td colspan="3">{$tc_vo['tczl']|default="/"}</td>
        <td></td>
        <td colspan="2"></td>
        <td colspan="1">{$tc_vo.tcf|default="/"}</td>
        {/if}
        {else}
        <td colspan="3"><?php echo str_replace("服务","服务",$tc_vo['tczl']);?></td>
        <td>
          {if  condition="$tc_vo.bjmp eq 1"} 是
          {elseif condition="$tc_vo.bjmp eq 2"/}/
          {else/}/{/if}
        </td>
        <td colspan="2">{$tc_vo.money|default="/"}</td>
        <td colspan="1">{$tc_vo.tcf|default="/"}</td>
        {/eq}
      </tr>
      {/foreach}

      {php}
      for($n=1;$n<=$line;$n++){
      {/php}
      <tr>
        <td colspan="3"></td>
        <td></td>
        <td colspan="2"></td>
        <td colspan="1"></td>
      </tr>
      {php}
      }
      {/php}
      <tr>
        <td colspan="7" style="text-align: left;">服务费合计（人民币大写）:<div id="daxie" style="display: inline-block;"></div><font style="width: 100px;margin-left: 30%; float: right;" >(￥: <div style="display: inline-block" id="money">{$res.main_free}</div>元)</font></td>
      </tr>
      <tr>
        <td colspan="7" style="text-align: left;">服务期间 &nbsp;自&nbsp;&nbsp;&nbsp;
          {$res.plan_strattime|date='Y-m-d H:i:s',###} 时起&nbsp;至&nbsp;&nbsp;
          <?php $jie = $res['plan_endtime']- strtotime(date('Y-m-d',$res['plan_endtime']));?>
          <?php if($jie == 86399 || $jie == 0){?>
          {$res.plan_endtime|date='Y-m-d',###}  二十四时止
          <?php }else{?>
          {$res.plan_endtime|date='Y-m-d H:i:s',###} 时止
          <?php }?>
        </td>
      </tr>
      <tr>
        <td style="height:80px;">
          特别约定
        </td>
        <td colspan="6" ><?php echo str_replace("互助","服务",$res['special']);?></td>
      </tr>
      <tr>
        <td colspan="7" style="text-align: left;">
          服务合同争议解决方式：诉讼
        </td>
      </tr>
      <tr>
        <td>重要提示</td>
        <td colspan="6" style="text-align: left;">
          1、本合同由服务条款、服务提示、服务单、服务批单和特别约定组成。<br />
          2、收到本服务单、服务项目对应的服务条款后，请立即核对。如有不符或疏漏，请及时通知我司并办理变更或补充手续。<br />
          3、请详细阅读服务种类相应的服务条款，特别是责任免除和责任处理。<br />
          4、机动车因改装、加装、改变使用性质等导致危险程度显著增加以及转卖、转让、赠送他人的，应通知我司并办理变更手续。<br />
          5、服务车辆发生交通事故后应立即通知我司。<br />
          6、车辆发生服务事故应当先由交强险部分赔偿，不足部分依合同约定后进行补偿。<br/>
          7、被服务人直接或间接缴纳服务费，我司即视为被服务人已知晓服务合同规定的免除我司责任条款的内容及法律后果。
        </td>
      </tr>

      <tr>
        <td>公司</td>
        <td colspan="6">
          <span style="text-align: left !important;height: 20px;display: block;width: 50%;float: left;line-height: 20px;">公司名称：{$site.bjd_company}</span>
          <span style="text-align: left !important;;height: 20px;display: block;width: 50%;float: left;line-height: 14px;">公司地址：{$site.bjd_address}</span>
          <span style="text-align: left !important;;height: 20px;display: block;line-height: 20px;float: left;width: 100%;">邮编：{$site.bjd_zip_code}</span>
          <span style="text-align: left !important;;height: 20px;display: block;width:35%;float: left;line-height: 20px;">全国统一客服电话：{$site.bjd_phone}</span>
          <span style="text-align: left !important;;height: 20px;display: block;width:30%;float: left;line-height: 20px;">签单日期：{$res.yw_hetong_time|date='Y-m-d',###}</span>
          <span style="text-align: left !important;;height: 20px;display: block;width:15%;float: left;line-height: 20px;">公司盖章：</span>
        </td>
      </tr>
      <tr>
        <td colspan="7" style="overflow: hidden;">
          <span style="text-align: left;display: block;height: 20px;line-height: 20px;width: 33%;float: left;">审核：华资在线 </span>
          <span style="text-align: left;display: block;height: 20px;line-height: 20px;width: 33%;float: left;">制单：华资在线 </span>
          <span style="text-align: left;display: block;height: 20px;line-height: 20px;width: 33%;float: left;">经办：华资在线 </span>
        </td>
      </tr>
    </table>
    <div style="position: relative;bottom: 210px;right: -610px;"><img src="{$site.bjd_fwz}" width="180"></div>
    <div style="margin-top: -150px;float:right;    margin-right: 45px;">
      <?php if($res['tk_type'] == 1 || $res['jiaofei'] == 2){?>
      <p style="text-indent:193px;text-autospace:none;text-align:justify;text-justify:inter-ideograph">
                <span style="position:absolute;z-index:-1;left:0px;margin-left:141.2500px;margin-top:156.6667px;width:65.0000px;height:57.0000px">
                    </span><span style="font-family: 宋体;font-size: 24px"><img style="position: relative;top: 31px;left: -15px;width: 11%;" src="/assets/img/logo.png" title="1641541697419545.png" alt="图片1.png"/>汽车服务有限公司</span>
      </p>
      <p style="margin-top:70px;margin-bottom:10px;text-indent:32px;text-autospace:none;text-align:center;line-height:33px">
        <span style="font-family: 宋体;font-size: 16px;font-weight:bold;padding-top:20px;padding-bottom:30px;display:block">机动车综合交通安全互助服务条款</span><span style="font-family: 宋体;font-size: 16px"></span>
      </p>
      <?php echo $tiaokuan['content'];?>
      <?php }?>
      {if !$sign}
      <p style="text-indent:244px">
        <span style="font-family: 宋体;font-size: 19px">被服务人签章处：</span><span style="text-decoration:underline;"><span style="font-family: 宋体;font-size: 19px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
      </p>
      <p style="margin-top:31px;text-indent:244px">
        <span style="font-family: 宋体;font-size: 19px"><span style="font-family:宋体">日期：</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;月 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日</span>
      </p>
      {else}
      <p style="text-indent:244px">
        <span style="font-family: 宋体;font-size: 19px">被服务人签章处：</span><span style="text-decoration:underline;"><span style="font-family: 宋体;font-size: 19px"><img src="/{$sign.sign_pic}" alt="" style="margin-bottom: -50px;"> </span></span>
      </p>
      <p style="margin-top:31px;text-indent:244px">
        <span style="font-family: 宋体;font-size: 19px"><span style="font-family:宋体">日期：</span> &nbsp;&nbsp;&nbsp;<?php echo date('Y',strtotime($sign['sign_time']));?>&nbsp;&nbsp;年 &nbsp;&nbsp;<?php echo date('m',strtotime($sign['sign_time']));?>&nbsp;&nbsp;月 &nbsp;&nbsp;<?php echo date('d',strtotime($sign['sign_time']));?>&nbsp;&nbsp;日</span>
      </p>
      {/if}
      <p>
        <br/>
      </p>
    </div>
  </div>
  <div class="fuxuan">
    <div class="f_list">
      <input type="checkbox" id="option1" name="options" value="a" style="transform:scale(1.5)" <?= $sign? ' checked="checked"' : '';?>>
      <label for="option1">本人已阅读和同意 </label><span id="jj1" style="color:#3683d3">《服务条款》</span><span id="jj2" style="color:#3683d3">《免责说明书》</span>
    </div>
    <div class="f_list">
      <input type="checkbox" id="option2" name="options" value="b" style="transform:scale(1.5)" <?= $sign? ' checked="checked"' : '';?>>
      <label for="option2">本人已充分理解并接受上述内容，同意以此作为订立服务合同的依据。</label>
    </div>
    <div class="f_list">
      <input type="checkbox" id="option3" name="options" value="c" style="transform:scale(1.5)" <?= $sign? ' checked="checked"' : '';?>>
      <label for="option3">服务合同责任开始前，被服务人要求解除服务合同的应当向我司支付应交服务费金额10%的工本费</label>
    </div>
    <div class="f_list">
      <input type="checkbox" id="option4" name="options" value="d" style="transform:scale(1.5)" <?= $sign? ' checked="checked"' : '';?>>
      <label for="option4">本人已进行客户信息授权回写</label>
    </div>

  </div>
  {if !$sign}
  <div style="margin:80px 0 ">
    <!--    <a style="display:block;border-radius:8px;width:90%;margin:0 auto;background: #3683D3;color:#fff;padding:20px;font-size:35px;text-decoration: none;box-sizing:border-box;text-align:center" href="/index/index/lizi?id={$data.id}&type={$data.type}&time={$data.time}&channel_id={$data.channel_id}">-->
    <!--      点击签字-->
    <!--    </a>-->
    <div style="border-radius:8px;width:90%;margin:0 auto;background: #3683D3;color:#fff;padding:20px;font-size:35px;text-decoration: none;box-sizing:border-box;text-align:center" class="tan_qianzi aa">
      点击签字
    </div>
    <div style="border-radius:8px;width:90%;margin:0 auto;background: #3683D3;color:#fff;padding:20px;font-size:35px;text-decoration: none;box-sizing:border-box;text-align:center" class="tan_qianzi bb">
      点击签字
    </div>
    <div class="imgDiv" style="display: none;" id="sign_show">
      <img src="" alt="" id="signpic"/>
    </div>
  </div>
  {/if}
</div>
<!--弹窗-->
<div class="model_k">
  <div class="model">
    <div class="model_val">
      <div class="model_tit">签名授权</div>
      <div class="model_tip">
        您同意采用电子签名的方式签订本次协议，并同意由您本人或授权他人向北京数字认证股份有限公司申请电子签名认证证书，自愿遵守其电子认证业务规则。请您保证提交的申请资料真实、准确、完整，并愿意承担由于资料虚假失实而导致的一切后果。
      </div>
      <div class="model_btn">
        <div class="mbtn" id="close">取消</div>
        <a class="mbtn que"  href="/index/index/lizi?id={$data.id}&type={$data.type}&time={$data.time}&channel_id={$data.channel_id}" id="queding">确定</a>
      </div>
    </div>

  </div>
</div>
<style>
  .fuxuan{
    padding: 0 50px;
    box-sizing: border-box;
    font-size: 28px;
  }
  .aa{
    display: none
  }
  .bb{
    opacity: 0.5
  }
  .f_list{
    margin-bottom: 20px;
  }
</style>
<script src="/assets/js/jquery-3.2.1.min.js"></script>
<script src="/assets/js/html2canvas.js"></script>
<script src="/assets/js/jspdf.min.js"></script>
<script src="/assets/js/esign.js"></script>
<script src="/assets/js/layui/layui.all.js"></script>
<script>

  $(function(){
    document.querySelectorAll('input[type="checkbox"]').forEach(checkbox => {
      checkbox.addEventListener('change', function() {
        let allChecked = true;
        document.querySelectorAll('input[type="checkbox"]').forEach(cb => {
          if (!cb.checked) {
            allChecked = false;
          }
        });
        if(allChecked){
          $(".aa").show()
          $(".bb").hide()
        }else{
          $(".aa").hide()
          $(".bb").show()
        }
        console.log('所有复选框是否都已选中:', allChecked);
      });
    });
    $("#jj1").click(function(){
      window.location.href="/index/index/li2?id={$data.id}&type={$data.type}&time={$data.time}&channel_id={$data.channel_id}"
    })
    $("#jj2").click(function(){
      window.location.href="/index/index/li?id={$data.id}&type={$data.type}&time={$data.time}&channel_id={$data.channel_id}"
    })

    if({$res.bjt}==1){
      $(".tongyin_bg").css("background","url(/assets/js/ace1.4/assets/images/p_bg.png)")
      $(".tongyin_bg").css("position","relative")
      $(".tongyin_bg").css("background-position-y"," 64%")
      $(".tongyin_bg").css("background-size"," 99%")
    }else{
      // $(".tongyin_bg").css("background","#fff")
      $(".tongyin_bg").css("background","url({$site.bjd_bj})")

      $(".tongyin_bg").css("position","relative")
      $(".tongyin_bg").css("background-size"," 100%")
      // $(".tongyin_bg").css("padding-bottom"," 250px")

    }
    //初始化动作，根据DOM的ID不同进行自定义，如果不写则内部默认取这四个
    $().esign("canvasEdit", "sign_show", "sign_clear", "sign_ok");
    // $('.Step1').fadeIn()
    // getFuc(0)
  });
  $(".aa").click(function(){
    $(".model_k").show()
  })
  $("#close").click(function(){
    $(".model_k").hide()
  })
  $("#queding").click(function(){
    $(".model_k").hide()
  })
  $('.sign_btn').click(function(){
    setTimeout(function(){
      let files = $('#sign_show').find('img').attr('src');
      $.ajax({
        type:"post",
        dataType:'json',
        url:"/index/index/imgbas",
        data:{file:files},
        success:function(data){
          if(data.status == 200){
            $.ajax({
              type:"post",
              dataType:'json',
              url:"/index/index/postsign",
              data:{urls:data.data,id:{$orderid}},
              success:function(data){
                if(data.status == 200){
                  layer.msg(data.msg, {icon: 1, time: 3000});

                  setTimeout(function() {
                    console.log(222);
                    window.location.href = document.referrer;
                  }, 3000);

                  // location.reload();
                  return false;
                }else{
                  layer.msg(data.msg);
                  return false;
                }
              }
            });
          }else{
            layer.msg(data.msg);
            return false;
          }
        }
      });
    },200)
  })
</script>
<script>
  function exportPdf(btn) {
    $(btn).hide();
    window.print();
    // var pdf = new jsPDF('p', 'px', 'a4');
    // pdf.internal.scaleFactor = 1;
    // var options = {
    //     pagesplit: true
    // };
    //
    // //$('.pdf-wrapper')
    // pdf.addHTML($('#tongyin'), function () {
    //     pdf.save('{$res.tong_number}.pdf');
    // });
  }
  //js  转换大写金额
  //小写转大写
  function cmycurd(num) {  //转成人民币大写金额形式
    var str1 = '零壹贰叁肆伍陆柒捌玖';  //0-9所对应的汉字
    var str2 = '万仟佰拾亿仟佰拾万仟佰拾元角分'; //数字位所对应的汉字
    var str3;    //从原num值中取出的值
    var str4;    //数字的字符串形式
    var str5 = '';  //人民币大写金额形式
    var i;    //循环变量
    var j;    //num的值乘以100的字符串长度
    var ch1;    //数字的汉语读法
    var ch2;    //数字位的汉字读法
    var nzero = 0;  //用来计算连续的零值是几个

    num = Math.abs(num).toFixed(2);  //将num取绝对值并四舍五入取2位小数
    str4 = (num * 100).toFixed(0).toString();  //将num乘100并转换成字符串形式
    j = str4.length;      //找出最高位
    if (j > 15) { return '溢出'; }
    str2 = str2.substr(15 - j);    //取出对应位数的str2的值。如：200.55,j为5所以str2=佰拾元角分

    //循环取出每一位需要转换的值
    for (i = 0; i < j; i++) {
      str3 = str4.substr(i, 1);   //取出需转换的某一位的值
      if (i != (j - 3) && i != (j - 7) && i != (j - 11) && i != (j - 15)) {    //当所取位数不为元、万、亿、万亿上的数字时
        if (str3 == '0') {
          ch1 = '';
          ch2 = '';
          nzero = nzero + 1;
        }
        else {
          if (str3 != '0' && nzero != 0) {
            ch1 = '零' + str1.substr(str3 * 1, 1);
            ch2 = str2.substr(i, 1);
            nzero = 0;
          }
          else {
            ch1 = str1.substr(str3 * 1, 1);
            ch2 = str2.substr(i, 1);
            nzero = 0;
          }
        }
      }
      else { //该位是万亿，亿，万，元位等关键位
        if (str3 != '0' && nzero != 0) {
          ch1 = "零" + str1.substr(str3 * 1, 1);
          ch2 = str2.substr(i, 1);
          nzero = 0;
        }
        else {
          if (str3 != '0' && nzero == 0) {
            ch1 = str1.substr(str3 * 1, 1);
            ch2 = str2.substr(i, 1);
            nzero = 0;
          }
          else {
            if (str3 == '0' && nzero >= 3) {
              ch1 = '';
              ch2 = '';
              nzero = nzero + 1;
            }
            else {
              if (j >= 11) {
                ch1 = '';
                nzero = nzero + 1;
              }
              else {
                ch1 = '';
                ch2 = str2.substr(i, 1);
                nzero = nzero + 1;
              }
            }
          }
        }
      }
      if (i == (j - 11) || i == (j - 3)) {  //如果该位是亿位或元位，则必须写上
        ch2 = str2.substr(i, 1);
      }
      str5 = str5 + ch1 + ch2;

      if (i == j - 1 && str3 == '0') {   //最后一位（分）为0时，加上"整"
        str5 = str5 + '整';
      }
    }
    if (num == 0) {
      str5 = '零元整';
    }
    return str5;
    console.log(str5);
  }


  var nums = $('#money').html();
  var daxie = cmycurd(nums);
  $('#daxie').text(daxie);
</script>
<!--endprint-->
</body>


</html>
